package cn.zhf.shop.service.impl;

import cn.zhf.shop.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import cn.zhf.shop.mapper.CreditBankMapper;
import cn.zhf.shop.entity.CreditBank;
import cn.zhf.shop.service.CreditBankService;
@Service
public class CreditBankServiceImpl implements CreditBankService{

    @Resource
    private CreditBankMapper creditBankMapper;

    @Override
    public Message deleteByPrimaryKey(Integer creditBankId) {
        return creditBankMapper.deleteByPrimaryKey(creditBankId) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insert(CreditBank record) {
        return creditBankMapper.insert(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insertSelective(CreditBank record) {
        return creditBankMapper.insertSelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message<CreditBank> selectByPrimaryKey(Integer creditBankId) {
        return Message.success(null).add(creditBankMapper.selectByPrimaryKey(creditBankId));
    }

    @Override
    public Message updateByPrimaryKeySelective(CreditBank record) {
        return creditBankMapper.updateByPrimaryKeySelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(CreditBank record) {
        return creditBankMapper.updateByPrimaryKey(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message<List<CreditBank>> selectAll() {
        return Message.success(null).add(creditBankMapper.selectAll());
    }

}
